Method and device for reducing image by palette modification

ABSTRACT

A method and device for reducing an input image by modifying the palette used in image compression. The reduction process involves mapping one or more colors of the original palette to a single color in a new palette. The image size of the reduced image is estimated from the entropy of the input image and that of the modified palette. A scaling factor, which can be computed from the image statistics inherent to the input image, is also used for adjusting the estimated image size of the reduced image.

FIELD OF THE INVENTION

The present invention relates generally to image processing and, morespecifically, to file size reduction for images stored in apalette-based compressed form.

BACKGROUND OF THE INVENTION

Often, the size of a digital image stored on one device may need to bereduced in order for the image to be stored or displayed on a differentdevice. For example, a large, high-quality digital image stored on aserver may exceed the memory limitations of a mobile device. In orderfor the mobile device to store and display the image, it would benecessary to reduce the size of the previously compressed image.

If memory capacity were the only limitation, it would be possible todevise an algorithm to reduce the image size as the image is received(prior to storage), rather than reducing the size prior to transmission.However, in reality, other limitations also apply. For example, someprotocols limit the maximum message size that can be transmitted to themobile device. In that case, the image size must be reduced prior to(not after) transmission. Additionally, even when the maximum messagesize is sufficient to accommodate the image, reducing image size on thereceiving end may waste significant bandwidth, resulting in costinefficiencies.

Furthermore, because processing time is directly related to how manyimages per second an operator can handle, there is a clear economicrelationship between the time taken to reduce an image and the cost ofdoing so. Such a relationship exists for multimedia messaging services,motivating the need for an efficient size-reduction method. In thisspecification, “size” means the number of bytes utilized by thecompressed image. Thus, a “large” image is one that occupies many bytesin a storage space.

In the past, palette-based compressed images were reduced using abrute-force approach, where the compressed image is partiallydecompressed by decoding it to yield palette index values. The partiallydecompressed image is re-quantized using an altered palette andrecompressed repeatedly until the size of the re-compressed image meetsa target size. As shown in FIG. 1, the brute-force approach usuallyinvolves many iterative steps. If the recompressed image is too large ortoo small as compared to the target size, the palette is readjusted andthe palette indices are updated to reflect the new palette. Thisbrute-force approach, in general, is time-consuming due to the repeatedcompression. In the above-described method, the repeated compression isterminated when the size of the recompressed image meets the targetsize. Alternatively, the repeated compression can be terminated when thequality of the recompressed image reaches an unacceptable level. In thisalternative approach, a palette is selected to meet a target number ofpalette colors, and an output image is produced based on the selectedpalette so as to allow a user to judge whether the quality of the outputimage is acceptable. This approach requires the input of a user and,therefore, is unsuitable for an image-related application in anautomated environment.

It should be noted that image size reduction could also be achieved bydecreasing the image resolution or by changing the compression format.However, resolution reduction may not always be desirable in that it maynot yield acceptable image quality. While format conversion may produceimages of comparable quality, it may not result in a smaller image size.Because palette-based schemes are almost always followed by losslesscompression, such as in the GIF format, there is no scope for reducingthe size of the image after a palette has been developed. When acompressed image in the GIF format is converted to the JPEG format, forexample, the size of the converted image may actually increase.

Most previous work with image palettes is concerned with mapping truecolor (RGB) values of an image onto a finite-size palette, or mappingone palette to another palette. The former approach, which is generallyassociated with a display device, has been disclosed in Shibata et al.(JP07-037059). The latter approach, which is used when the size of thenew palette is known but the palette content may be unknown, has beendisclosed in Okuda et al. (JP11-306067). Although these approaches canreduce colors of an image to achieve a certain palette size, they may ormay not lead to size reduction. Moreover, the amount of image sizereduction cannot be predicted or controlled.

It is desirable and advantageous to provide a method and device forimage size reduction wherein the iterative steps can be reduced both innumber and in complexity, and wherein the amount of image size reductioncan be estimated and controlled.

SUMMARY OF THE INVENTION

The present invention reduces an input image by modifying the paletteused in color quantization. It involves mapping one or more colors fromthe original palette to a single color in a new palette.

According to the first aspect of the present invention, there isprovided a method of reducing an input image of an original image size(F, N) for providing a reduced image of a target image size (F_(n))smaller than the original image size, wherein the input image is formedfrom a first palette and contains image statistics (L,H) inherent topalette index coefficients indicative of the input image, the firstpalette having a first palette size with a first number of colors. Themethod comprises the steps of:

selecting a second palette size smaller than the first palette size; and

color mapping the first palette based on the second palette size forproviding a second palette for use in forming the reduced image, thesecond palette having a second number of colors smaller than the firstnumber of colors by a reduction ratio (R).

Preferably, the method also comprises the steps of:

obtaining a first statistical size (S₀) of the input image based on theimage statistics (L, H) and the original image size (N) of the inputimage;

computing a second statistical size (S) of the reduced image based onthe second palette; and

estimating the image size (S_(f)) of the reduced image based on thefirst image size (F), the first statistical size (S₀), the secondstatistical size (S) and the reduction ratio (R).

Preferably, the method further comprises the steps of:

adjusting the second palette size; and

repeating the color mapping, computing and estimating steps until adifference between the estimated image size (S_(f)) and the target imagesize (F_(n)) falls within a predetermined limit.

According to the second aspect of the present invention, there isprovided a device for reducing an input image of an original image size(F, N) to provide a reduced image of a target image size (F_(n)) smallerthan the original image size, wherein the input image is formed from afirst palette and contains image statistics (L,H) inherent to paletteindex coefficients indicative of the input image, the image statisticsproviding a first statistical size (S₀), the first palette having afirst palette size with a first number of colors, and wherein said imagesize reduction is based on a selected palette size. The device comprises

a color mapping means, responsive to the selected palette size, forobtaining a second palette and for providing palette informationindicative of the second palette, the second palette having a secondnumber of colors smaller than the first number of colors by a reductionratio (R) for use in forming the reduced image.

Preferably, the device further comprises:

a computing means, responsive to the palette information, for providinga second statistical size (S) of the reduced image based on the secondpalette; and

an estimating means, responsive to the second statistical size (S), forproviding an estimated image size (S_(f)) of the reduced image, based onthe first image size (F), the reduction ratio (R), the first statisticalsize (S₀).

Advantageously, a scaling factor (ESF) is provided for adjusting theestimated image size (S_(f)).

The present invention will become apparent upon reading the descriptiontaken in conjunction with FIGS. 2 to 4.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a brute-force image reductionapproach.

FIG. 2 is a block diagram illustrating the principle of image reduction,according to the present invention.

FIG. 3 is a flowchart illustrating the image reduction method, accordingto the present invention.

FIG. 4 is a block diagram illustrating a device for image reduction,according to the present invention.

BEST MODE TO CARRY OUT THE INVENTION

The present invention applies to images that have already beencolor-quantized to a finite-color palette and compressed, such as imagesstored in the GIF format. The method involves the steps of determininghow the palette should be adjusted in order to reduce the image to atarget size. The present invention makes use of image statistics, suchas the average run-length between index changes and the histogram,inherent to an input image that has been previously compressed. Thus, inorder to gather the image statistics, the compressed image must bedecoded or partially decompressed.

As shown in FIG. 2, a previously-compressed image 110 is partiallydecompressed by a decoder 12 so that the palette indices in the inputimage can be read. Based on the average run-length between index changesand histogram read from the partially decompressed image 112, a filesize estimator 50 is used to estimate the size of an output image formedfrom a new palette of a reduced palette size. Given the statistics ofthe input image, the estimator 50 uses a computation means 52 toestimate the color needs in the new palette that would be used tore-quantize the partially decompressed image before the partiallydecompressed image is recompressed to produce an output image. Given theestimated number of colors in the new palette, a corresponding estimateof the output image size using that palette can be produced. It may bethat the estimated size of the output image does not meet the targetsize. The estimation process must usually be iterated several timesbefore the estimated size of the output image meets the target size. Ineach iteration, the new palette is refined by an adjusting means 54.Finally, after the predicted size meets the target size, there-quantized image 150 is re-compressed by a compression module 60 forproviding an output image 160.

The statistics of primary importance required by the estimator 50 arethe image histogram and the average run-length L between a change ofpalette index values. The statistics can be found by raster scanning thepartially decompressed image 112 only once in a straightforward manner.The image histogram, which is the number of times each palette indexoccurs, can be directly used to compute the entropy H₀ of the indexterms in the original compressed image. In general, entropy H in “bitsper pixel” can be calculated from the image histogram as follows:$\begin{matrix}{H = {{- \frac{1}{N}}{\sum\limits_{\quad i}^{\quad}\quad{{p(i)}\log_{2}{p(i)}}}}} & (1)\end{matrix}$where N is the number of pixels in the compressed image, and p(i) is theprobability of palette index i occurring, equivalent to p(i)=C_(i)/N,C_(i) being the number of times palette index i occurs in the image, andthe series of C_(i) values is the image “histogram”.

A prediction of the compressed image size in bits, hereafter referred toas the statistical size, is given by the number N of pixels times theentropy H as follows: $\begin{matrix}{S = {- {\sum\limits_{\quad i}^{\quad}\quad{{p(i)}\log_{2}{{p(i)}\quad.}}}}} & (2)\end{matrix}$

At first glance, it seems possible to use the statistical size, asdefined by Eq. 2, to directly predict the file size of a reducedcompressed image, so long as one can estimate the color needs in a newpalette for re-quantizing the partially decompressed image. However,such prediction is not always accurate. There are two problems with sucha simplistic predictor. First, it assumes that each pixel in the imageis independent of all other pixels. That is, knowing one pixel valuetells us nothing about its neighbors. In practice, this is generallyquite untrue, because graphical images tend to contain large regions ofsolid color. Thus, if one pixel value is known, the prediction that theneighboring pixel value will be the same has a good chance of beingcorrect. Because the simple entropy calculation above fails to take intoconsideration the “correlation” between pixels, the estimated size ofthe image may be inflated. Secondly, the prediction also assumes thatthe compression method used in practice is as good as the theoreticallimit. In reality, this is rarely true. Compression algorithms tend totake “short cuts” due to memory or complexity constraints, and almostnever reach the theoretical limit. This applies to the LZW(Lempel-Ziv-Welch, also known as LWZ) scheme employed by the GIF format,and this means the entropy measure is sometimes less than the actualcompressed size.

One way to correct the former problem is to consider the “second-order”entropy of the image. Since LZW compression is dictionary-based and canencode several pixels at once, we can expand the histogram to measurethe number of “pairs” of index coefficients, so that the size predictionbecomes $\begin{matrix}{S_{2} = {- {\sum\limits_{i}^{\quad}\quad{\sum\limits_{j}^{\quad}\quad{{p\left( {i,\quad j} \right)}\log_{2}{p\left( {i,\quad j} \right)}}}}}} & (3)\end{matrix}$where (i, j) are the palette index values of adjacent pixels in theoriginal compressed image. This concept can be extended to considerlarger sequences of pixels, but the approach encounters complexityproblems, and the memory required for temporary storage can becomeprohibitive. Additionally, this approach does not solve the secondproblem of inherent inefficiency in the LZW algorithm.

Thus, according to the present invention, these above-identifiedproblems are rectified by “scaling” the entropy value depending on otherimage statistics, in order to achieve a viable estimate without paying alarge computational or memory penalty. The scaling process is describedbelow.

Two other statistics of interest include the color ratio R and theaverage run length L. The color ratio R is the ratio of the proposednumber of colors (the number of colors in the proposed new palette) tothe number of colors in the original palette. Average run length L isdefined as the average distance (in pixels) between a change in theindex value, assuming the pixels are scanned in raster fashion. Averagerun length can be calculated in one raster scan of the image at the sametime as the histogram is obtained, using the pseudocode below.

for y = 1 to image_height for x = 1 to image_width idx = colour index ofpixel at (x,y) histogram[idx] = histogram[idx] + 1 if idx <> last_index,total_rl = total_rl + this_rl rl_count = rl_count + 1 last_index = idxthis_rl = 0 else this_rl = this_rl + 1 end end L = total_rl / rl_count

Having obtained these “secondary statistics”, the present inventioncarries out entropy scaling depending on the characteristics of theinput image as follow:

-   -   a) In most cases, the average run length L can be scaled using a        hyperbolic function, such as        Lγ=0.3+tan h(L−1)  (4)        in order to make it a more meaningful value for the entropy        calculation. An entropy scaling factor (ESF) is then calculated        as        ESF=1+0.05log ₂ R.Lγ  (5)        where R is the color ratio. Since the number of colors in the        palette is always reduced, the ratio is always less than one,        meaning that ESF is generally slightly less than one. This        scaling is based on the fact that as the number of colors        decreases, the average run length will become longer, and thus        the entropy measure will start to become inflated.

b) When the average run length is small, or less than some thresholdT_(rl) the first-order entropy will be only slightly different from thehigher-order entropies. For example, a threshold of T_(rl)=0.5 can beused, meaning that, on average, no more than half the pixels have thesame index as their neighbor does for this section to apply.Consequently, there is only a small possibility of inflating theestimate, although there is still the possibility of deflating theestimate due to inefficiencies in the LZW algorithm. In such cases, Lγ=1is used and ESF becomesESF=1+0.05log ₂ R  (6)

-   -   c) When the original number of colors is very small, or less        than some threshold T_(c), inflation of the estimate due to the        use of the first-order entropy will not be exacerbated by        removing additional colors. Therefore, an ESF of one can be        used, or        ESF=1  (7)

Each scale factor is clipped to ensure that it falls within reasonablebounds. It should be noted that because the estimate is based upon imagestatistics, it is possible that an “unusual” image will cause the valueof ESF to be extremely high or extremely low, to the point of beingmeaningless. To circumvent such problems, a lower bound and upper boundcan be used to limit the scale factor. For example, if the calculatedESF is less than the lower bound, it is set to the lower bound. If thecalculated ESF is greater than the upper bound, it is set to the upperbound. If it falls between the bounds, it is left untouched. Otherscaling or clipping functions can be used depending upon the statisticalprofile of images being processed.

In addition to scaling the entropy to account for “overshoots” or“undershoots” due to the image characteristics, the estimate is alsonormalized by measuring the entropy of the original compressed image.Thus, the file size estimate is given by $\begin{matrix}{S_{f} = {S \times {ESF} \times \frac{F}{S_{o}}}} & (8)\end{matrix}$where F is the file size of the originally compressed image, S₀ is thestatistical size of the original compressed image, and S is thestatistical size related to the image re-quantized by the new palette.

The foregoing description has assumed that a target number of colors inthe new palette is known and, accordingly, the size of the output imageif it were compressed using that palette can be estimated. In reality,the target palette size is not known; it can be found by repeating theestimation process several times and comparing the estimated and targetsizes. The iteration process for finding the target palette can becarried out in accordance with the pseudocode example as shown below:

palette_size = initial_pal_size est_size = target_size + 1 while(target_size < est_size) est_size = size estimated using algorithm if(est_size > target_size) adjust palette_size end

As shown in Eq.5 and Eq.8, the file size prediction, S_(f) requires fiveterms: the file size of the original (F), the original statistical size(S₀), the average run-length (L), the color ratio (R), and thestatistical size (S) of the proposed output image that can be calculatedfrom the image histogram. Of these terms, the first three are calculatedonce and do not need to be updated for each predictive iteration,whereas the last two must be re-calculated. Since the color ratio is asimple division, the effort required to update it is negligible. Hencethe bulk of the effort associated with iterating the estimation isassociated with re-calculating the histogram. The efficiency with whichthis invention is able to update the histogram is worthy of particularattention.

To find a new palette of a certain size, the original palette is treatedas an image, consisting of one pixel in each of the original palettecolors. This “image” is then color-quantized to the desired palettesize. Not only does this process generate a new palette, but thiscolor-quantized “image” also indicates which new palette indexcorresponds to each of the old palette indices. Effectively, thisprocess yields the mapping function:î=M(i)  (9)Now consider the histogram. Since each pixel index in the original imageis now re-mapped to an index in the new palette, the number of each ofthe palette indices occurring in the new image will be $\begin{matrix}{{\hat{C}}_{i} = {\sum\limits_{\{{{j|{M{(j)}}} = i}\}}^{\quad}\quad C_{j}}} & (10)\end{matrix}$It should be noted that generating the new counts does not require theimage to be raster-scanned, as required in the gathering of thestatistics of the partially decompressed image. Instead, the new countscan be obtained by retaining the counts from the original image, andassigning them to the appropriate “bin” in the color-quantized version.In the case of the GIF format, this means a maximum of 256 additions,which can be considered a negligible effort. As such, the probability ofeach index in the proposed new image is known, and the statistical sizecalculation for the proposed new image can be carried out.

In summary, the estimation process is quick, and therefore iterating itinstead of the compression process (which is comparatively very slow)can produce a substantial savings in terms of computational effort.

Incorporating the foregoing analysis, a method of image size reductionfor achieving an output image with a target size F_(n) is illustrated inthe flowchart 200, as shown in FIG. 3. As shown in FIG. 3, after thecompressed image is received, it is decoded at step 210 to yield thepalette indices i. At step 212, the image statistics of the originalcompressed image 110 are gathered for computing the image entropy H (Eq.1), the statistical size S₀ (Eq.2) and ESF (Eq.6-Eq.8) at step 214. Apalette size is selected at step 216 so that a new palette can beobtained at step 218. From the mapping function between the new paletteand the original palette, the entropy of the new palette, and thus thestatistical size S of the proposed new image, are computed at step 220.As the color ratio R can be found, the file size S_(f) of the imageaccording with the new palette can be estimated (Eq.8) at step 222. Ifthe estimated size S_(f) is substantially equal to the target sizeF_(n), then the partially decompressed image re-quantized with the newpalette is recompressed for providing the output image 160 at step 226.If the estimate size S_(f) is smaller or greater than F_(n), the palettesize for the new palette is adjusted at step 228 and a new iterationstarts at step 218.

In order to facilitate the method of image size reduction, according tothe present invention, the estimator 50 (FIG. 2), can be constructedwith a number of components, as shown in FIG. 4. As shown in FIG. 4, animage scanning module 14 is used to raster scan the partiallydecompressed image 112 to yield palette index values i for providing theprobability p(i) of palette index i occurring. The image statisticsrelated to palette index values, their occurrence probability, and theaverage run-length L are denoted by reference numeral 114. An entropycomputation module 16, responsive to the image statistics 114, is usedto compute the entropy H, the statistical size S₀ of the originalcompressed image 110, and the entropy scaling factor, ESF. Thisentropy-related information provided by module 16 is collectivelydenoted by reference numeral 116. At this point, a proposed palette sizeshould be selected and the original palette is color-quantized by a newpalette generation module 20 to obtain a new palette. In fact, the newpalette can be produced from the old palette by the mapping functionî=M(i). The new indices and the occurrence probability of the newindices are denoted by reference numeral 120. Based on the indices ofthe new palette, the statistical size S of the proposed new imagecolor-quantized by the new palette is computed by module 30 using Eq.2.The statistical size S and other parameters (S₀, F, ESF, R),collectively denoted by reference numeral 130, are used to estimate thefile size S_(f) of the reduced image 160. (FIG. 2). The estimated filesize S_(f), is compared to the target file size F_(n) by a comparisonmeans 40. Based on the comparison result 140, an adjusted new palette142 is provided by adjustment means 42 to the entropy computation module30 for iteration. The process is repeated until the estimated size S_(f)is substantially equal to the target file size F_(n), or the differencebetween the estimated size S_(f) and the target file size F_(n) fallswithin a predetermined limit.

The proposed palette size must be updated by an adjustment means 42(FIG. 4) at step 228 (FIG. 3), when subsequent estimations are required.There are many possible approaches for palette size updating. One suchapproach is to decrement the palette size by one for each estimation(arithmetic progression). Alternatively, the palette size is reduced bya certain factor, such as 0.5, after each iteration (geometricprogression). A third approach would be to use a segmentation approach,which involves dividing the possible new palette sizes into half (e.g.1-127, 128-255) and determining which half the solution should belongto, then further dividing that section (e.g. 1-63, 64-127) until thesolution is found.

It should be noted that the entropy scaling factor (ESF), in most cases,is calculated using Eq. 5, where the average run-length L is scaledusing a hyperbolic function of the form:Lγ=α+tan h(L−1).  (11)However, any similar function can also be used for such scaling. Also,it is possible to use a scaling factor, which is slightly smaller than 1and independent of the color ratio R for estimating the file size usingEq. 8.

The present invention is agnostic toward the update method actuallyused. Additionally, because this is a statistical process and theestimate does not predict the size of a new compressed image with 100%accuracy, there is little benefit to be gained from iterating theprocess until the precise size of the new palette is found. Since theimprovement in estimated size would be outside the margin of error inthe algorithm, the iteration should be terminated when the differencebetween the estimated size (S_(f)) and the target file size (F_(n))falls within a reasonable limit. For the same reason, the updatealgorithm used will not play a significant role unless the palette sizeis sufficiently large.

Although the invention has been described with respect to a preferredembodiment thereof, it will be understood by those skilled in the artthat the foregoing and various other changes, omissions and deviationsin the form and detail thereof may be made without departing from thescope of this invention.

1. A method of reducing an input image of an original image size (F, N)for providing a reduced image of a target image size (F_(n)) smallerthan the original image size, wherein the input image is formed from afirst palette and contains image statistics (L,H) inherent to paletteindex coefficients indicative of the input image, the first palettehaving a first palette size with a first number of colors, said methodcomprising the steps of: selecting a second palette size smaller thanthe first palette size; and color mapping the first palette based on thesecond palette size for providing a second palette for use in formingthe reduced image, the second palette having a second number of colorssmaller than the first number of colors by a reduction ratio (R),wherein the reduction ratio is at least partially based on arelationship between the target image size and the original image size.2. The method of claim 1, wherein the second palette size is selectedbased on the image statistics of the first palette.
 3. The method ofclaim 2, wherein the image statistics include entropy (H) of the paletteindex coefficients in the input image.
 4. The method of claim 2, whereinthe image statistics include entropy (H) and average run length (L) ofthe palette index coefficients in the input image.
 5. The method ofclaim 1, wherein the input image is provided in a GIF format.
 6. Amethod of reducing an input image of an original image size (F, N) forproviding a reduced image of a target image size (F_(n)) smaller thanthe original image size, wherein the input image is formed from a firstpalette and contains image statistics (L,H) inherent to palette indexcoefficients indicative of the input image, the first palette having afirst palette size with a first number of colors, said method comprisingthe steps of: selecting a second palette size smaller than the firstpalette size; and color mapping the first palette based on the secondpalette size for providing a second palette for use in forming thereduced image, the second palette having a second number of colorssmaller than the first number of colors by a reduction ratio (R);obtaining a first statistical size (S₀) of the input image based on theimage statistics (L,H) and the original image size (N) of the inputimage; computing a second statistical size (S) of the reduced imagebased on the second palette; and estimating the image size (S_(f)) ofthe reduced image based on the first image size (F), the firststatistical size (S₀), the second statistical size (S) and the reductionratio (R).
 7. The method of claim 6, further comprising the steps ofadjusting the second palette size; and repeating the color mapping,computing and estimating steps until a difference between the estimatedimage size (S_(f)) and the target image size (F_(n)) falls within apredetermined limit.
 8. The method of claim 6, wherein the firststatistical size (S₀) is computed based on${S = {- {\sum\limits_{i}^{\quad}\quad{{p(i)}\log_{2}{p(i)},}}}}\quad$wherein p(i) is the probability of palette index i occurring, equivalentto p(i)=C_(i)/N, C_(i) being the number of times palette index i occursin the input image and N being the number of pixels in the input image.9. The method of claim 6, further comprising the step of providing ascaling factor (ESF) for adjusting the estimated image size (S_(f)). 10.The method of claim 9, wherein the scaling factor (ESF) is computedbased on the reduction ratio (R).
 11. The method of claim 10, whereinthe scaling factor (ESF) is computed from a logarithmic function of thereduction ratio (R).
 12. The method of claim of claim 11, wherein thescaling factor (ESF) is computed fromESF=1+0.005 log₂ R.
 13. The method of claim 9, wherein the scalingfactor (ESF) is computed based on the image statistics (L) and thereduction ration (R).
 14. The method of claim 13, wherein the imagestatistics include average run-length (L) of palette index coefficientsin the input image.
 15. The method of claim 14, wherein the scalingfactor (ESF) is computed from a logarithmic function of the reductionration (R) and a hyperbolic function of the average run-length of theinput image.
 16. The method of claim 15, wherein the scaling factor(ESF) is computed fromESF=1=0.05 log₂R.Lγ where Lγ=0.3+tanh(L−1).
 17. The method of claim 9,wherein the scaling factor ESF is equal to or slightly less than
 1. 18.A device for reducing an input image of an original image size (F, N) toprovide a reduced image of a target image size (F_(n)) smaller than theoriginal image size, wherein the input image is formed from a firstpalette and contains image statistics (L,H) inherent to palette indexcoefficients indicative of the input image, the image statisticsproviding a first statistical size (S₀), the first palette having afirst palette size with a first number of colors, and wherein said imagesize reduction is based on a selected palette size, said devicecomprising: color mapping means, responsive to the selected palettesize, for obtaining a second palette and for providing paletteinformation indicative of the second palette, the second palette havinga second number of colors smaller than the first number of colors by areduction ratio (R) for use in forming the reduced image, wherein thereduction ratio is at least partially based on a relationship betweenthe target image size and the original image size.
 19. The device ofclaim 18, wherein the second palette size is selected based on the imagestatistics of the first palette.
 20. The device of claim 19, wherein theimage statistics include entropy (H) of the palette index coefficientsin the input image.
 21. The device of claim 19, wherein the imagestatistics include entropy (H) and average run length (L) of the paletteindex coefficients in the input image.
 22. The device of claim 18,wherein the input image is provided in a GIF format.
 23. The device ofclaim 18, wherein the first statistical size (S₀) is computed based on${S = {- {\sum\limits_{i}^{\quad}\quad{{p(i)}\log_{2}{p(i)},}}}}\quad$wherein p(i) is the probability of palette index i occurring, equivalentto p(i)=C_(i)/N, C₁ being the number of times palette index i occurs inthe input image and N being the number of pixels in the input image. 24.A device for reducing an input image of an original image size (F, N) toprovide a reduced image of a target image size (F_(n)) smaller than theoriginal image size, wherein the input image is formed from a firstpalette and contains image statistics (L,H) inherent to palette indexcoefficients indicative of the input image, the image statisticsproviding a first statistical size (S₀), the first palette having afirst palette size with a first number of colors, and wherein said imagesize reduction is based on a selected palette size, said devicecomprising: color mapping means, responsive to the selected palettesize, for obtaining a second palette and for providing paletteinformation indicative of the second palette, the second palette havinga second number of colors smaller than the first number of colors by areduction ratio (R) for use in forming the reduced computing means,responsive to the palette information, for providing a secondstatistical size (S) of the reduced image based on the second palette;and estimating means, responsive to the second statistical size (S), forproviding an estimated image size (S_(f)) of the reduced image, based onthe first image size (F), the reduction ratio (R), the first statisticalsize (S₀).
 25. The device of claim 24, further comprising means forproviding a scaling factor (ESF) for adjusting the estimated image size(S_(f)).
 26. The device of claim 25, wherein the scaling factor (ESF) iscomputed based on the reduction ratio (R).
 27. The device of claim 26,wherein the scaling factor (ESF) is computed from a logarithmic functionof the reduction ratio (R).
 28. The device of claim of claim 27, whereinthe scaling factor (ESF) is computed fromESF=1+0.005log₂ R.
 29. The device of claim 25, wherein the scalingfactor (ESF) is computed based on the image statistics (L) and thereduction ration (R).
 30. The device of claim 29, wherein the imagestatistics including average run-length (L) of the input image.
 31. Thedevice of claim 30, wherein the scaling factor (ESF) is computed from alogarithmic function of the reduction ration (R) and a hyperbolicfunction of the average run-length of the input image.
 32. The device ofclaim 31, wherein the scaling factor (ESF) is computed fromESF=1+0.05 log₂ R.Lγ where Lγ=0.3+tanh(L−1).
 33. The device of claim 25,wherein the scaling factor ESF is substantially equal to
 1. 34. Thedevice of claim 25, wherein the scaling factor ESF is slightly lessthan
 1. 35. A software product comprising a computer readable medium foruse in reducing an input image of an original image size (F, N) forproviding a reduced image of a target image size (F_(n)) smaller thanthe original image size, wherein the input image is formed from a firstpalette and contains image statistics (L,H) inherent to palette indexcoefficients indicative of the input image, the first palette having afirst palette size with a first number of colors, the computer readablemedium having executable pseudo-codes embedded therein, and thepseudo-codes, when executed, carry out the steps of: selecting a secondpalette size smaller than the first palette size; and color mapping thefirst palette based on the second palette size for providing a secondpalette for use in forming the reduced image, the second palette havinga second number of colors smaller than the first number of colors by areduction ratio (R), wherein the reduction ratio is at least partiallybased on a relationship between the target image size and the originalimage size.
 36. The software product of claim 35, wherein thepseudo-codes further carry out the steps of: obtaining a firststatistical size (S₀) of the input image based on the image statistics(L, H) and the original image size (N) of the input image; computing asecond statistical size (S) of the reduced image based on the secondpalette; and estimating the image size (S_(f)) of the reduced imagebased on the first image size (F), the first statistical size (S₀), thesecond statistical size (S) and the reduction ratio (R).
 37. Thesoftware product of claim 36, wherein the pseudo-codes further carry outthe steps of adjusting the second palette size; and repeating the colormapping, computing and estimating steps until a difference between theestimated image size (S_(f)) and the target image size (F_(n)) fallswithin a predetermined limit.
 38. The software product of claim 36,wherein the pseudo-codes further carry out the step of providing ascaling factor (ESF) for adjusting the estimated image size (S_(f)), andwherein the scaling factor (ESF) is computed based on the imagestatistics (L) and the reduction ration (R), the image statisticsincluding average run-length (L) of palette index coefficients in theinput image, and the scaling factor (ESF) is computed fromESF=1+0.05 log₂ R.Lγ where Lγ=0.3+tanh(L−1).